package vsm.vsm_server.controller;


import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import vsm.vsm_server.pojo.Result.Result;
import vsm.vsm_server.pojo.User.Record.History.HistoryVideo;
import vsm.vsm_server.pojo.User.Record.History.WatchDTO;
import vsm.vsm_server.pojo.User.Record.Like.LikeVideo;
import vsm.vsm_server.pojo.User.VisitDTO;
import vsm.vsm_server.service.ActionService;
import vsm.vsm_server.service.HistoryService;

@Slf4j
@RestController
@RequestMapping("/history")
@CrossOrigin
public class HistoryController {
    @Autowired
    HistoryService historyService;
    @Autowired
    ActionService actionService;
    @PostMapping("/create")
    public Result<String> createHistoryVideo(@RequestBody WatchDTO watchDTO){
        log.info("保存历史纪录{}",watchDTO);
        historyService.createHistoryVideo(watchDTO);


        return Result.success();
    }

    @PostMapping("/visit")
    public void VisitUser(@RequestBody VisitDTO visitDTO){
        actionService.VisitUser(visitDTO);
    }

}
